package br.com.io.writeterandreader;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class LerArquivo {
	public static void main(String[] args) {
		try {
			
			//new InputStreamReader()
			FileReader fr = new FileReader("arquivo.txt");
			BufferedReader br = new BufferedReader(fr);
			
			StringBuilder sb = new StringBuilder();
			
			while(!(sb.append(br.readLine())).toString().equals("null")){
				System.out.println(sb);
				sb.delete(0, sb.length());
			}
			br.close();
			fr.close();
			
			
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		
	}
}
